home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1993 July / InfoMagic USENET CD-ROM July 1993.ISO / sources / x / volume13 / xfig2.9 / patch10.02 < prev    next >
Encoding:
Internet Message Format  |  1991-07-05  |  53.7 KB

  1. Path: uunet!olivea!oliveb!veritas!amdcad!sun!exodus!bea.lbl.gov
  2. From: envbvs@bea.lbl.gov (Brian V. Smith)
  3. Newsgroups: comp.sources.x
  4. Subject: v13i069: xfig2, Patch10, Part02/04
  5. Message-ID: <16332@exodus.Eng.Sun.COM>
  6. Date: 6 Jul 91 06:59:11 GMT
  7. References: <csx-13i068-xfig2.9@uunet.UU.NET>
  8. Sender: news@exodus.Eng.Sun.COM
  9. Lines: 1920
  10. Approved: argv@sun.com
  11.  
  12. Submitted-by: envbvs@bea.lbl.gov (Brian V. Smith)
  13. Posting-number: Volume 13, Issue 69
  14. Archive-name: xfig2.9/patch10.02
  15. Patch-To: xfig2.9: Volume 8, Issue 10-30
  16. Patch-To: xfig2.9: Volume 10, Issue 26-31
  17.  
  18. #! /bin/sh
  19. # This is a shell archive.  Remove anything before this line, then unpack
  20. # it by saving it into a file and typing "sh file".  To overwrite existing
  21. # files, type "sh file -c".  You can also feed this as standard input via
  22. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  23. # will see the following message at the end:
  24. #        "End of archive 2 (of 4)."
  25. # Contents:  patch10.3
  26. # Wrapped by envbvs@bea.lbl.gov.lbl.gov on Fri Jun 14 14:37:02 1991
  27. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  28. if test -f 'patch10.3' -a "${1}" != "-c" ; then 
  29.   echo shar: Will not clobber existing file \"'patch10.3'\"
  30. else
  31. echo shar: Extracting \"'patch10.3'\" \(51091 characters\)
  32. sed "s/^X//" >'patch10.3' <<'END_OF_FILE'
  33. X*** @xfig.pl9/movept.c    Wed May 16 14:31:20 1990
  34. X--- ./movept.c    Mon Jun  3 11:14:27 1991
  35. X***************
  36. X*** 13,21 ****
  37. X  #include "object.h"
  38. X  #include "paintop.h"
  39. X  
  40. X- #define            TOLERANCE    3
  41. X  extern int        latexline_mode, latexarrow_mode;
  42. X  extern int        magnet_mode;
  43. X  
  44. X  extern            (*canvas_kbd_proc)();
  45. X  extern            (*canvas_locmove_proc)();
  46. X--- 13,22 ----
  47. X  #include "object.h"
  48. X  #include "paintop.h"
  49. X  
  50. X  extern int        latexline_mode, latexarrow_mode;
  51. X  extern int        magnet_mode;
  52. X+ extern int        grid2_mode;
  53. X+ extern  appresStruct    appres;
  54. X  
  55. X  extern            (*canvas_kbd_proc)();
  56. X  extern            (*canvas_locmove_proc)();
  57. X***************
  58. X*** 43,48 ****
  59. X--- 44,50 ----
  60. X  extern            move_cbrbox(), move_cbdbox();
  61. X  
  62. X  extern int        init_move_point();
  63. X+ extern            point_search();
  64. X  extern int        move_linepoint(), fix_movedlinepoint();
  65. X  extern int        move_latexlinepoint(), fix_movedlatexlinepoint();
  66. X  extern int        fix_box();
  67. X***************
  68. X*** 63,69 ****
  69. X  {
  70. X      canvas_kbd_proc = null_proc;
  71. X      canvas_locmove_proc = null_proc;
  72. X!     canvas_leftbut_proc = init_move_point;
  73. X      canvas_middlebut_proc = null_proc;
  74. X      canvas_rightbut_proc = set_popupmenu;
  75. X      set_cursor(&pick9_cursor);
  76. X--- 65,72 ----
  77. X  {
  78. X      canvas_kbd_proc = null_proc;
  79. X      canvas_locmove_proc = null_proc;
  80. X!     init_point_search(init_move_point);
  81. X!     canvas_leftbut_proc = point_search;
  82. X      canvas_middlebut_proc = null_proc;
  83. X      canvas_rightbut_proc = set_popupmenu;
  84. X      set_cursor(&pick9_cursor);
  85. X***************
  86. X*** 70,100 ****
  87. X      reset_action_on();
  88. X      }
  89. X  
  90. X! init_move_point(x, y)
  91. X! int    x, y;
  92. X  {
  93. X      Boolean Ok=True;
  94. X  
  95. X!     if ((line = line_point_search(x, y, TOLERANCE,
  96. X!         &left_point, &moved_point)) != NULL) {
  97. X          init_linepointmoving(line);
  98. X!         }
  99. X!     else if ((spline = spline_point_search(x, y, 
  100. X!         TOLERANCE, &left_point, &moved_point)) != NULL){
  101. X          init_splinepointmoving(spline);
  102. X!         }
  103. X!     else if ((ellipse = ellipse_point_search(x, y, TOLERANCE, 
  104. X!         &movedpoint_num)) != NULL) {
  105. X          if (!init_ellipsepointmoving(ellipse))    /* selected center, ignore */
  106. X          Ok=False;
  107. X!         }
  108. X!     else if ((arc = arc_point_search(x, y, TOLERANCE, 
  109. X!         &movedpoint_num)) != NULL) {
  110. X          init_arcpointmoving(arc);
  111. X!         }
  112. X!     else {
  113. X          return;
  114. X!         }
  115. X      if (Ok)        /* movepoint went ok */
  116. X          {
  117. X          canvas_leftbut_proc = canvas_rightbut_proc = null_proc;
  118. X--- 73,111 ----
  119. X      reset_action_on();
  120. X      }
  121. X  
  122. X! init_move_point(obj, type, x, y, p, q)
  123. X! char *obj;
  124. X! int type,x,y;
  125. X! F_point *p,*q;
  126. X  {
  127. X      Boolean Ok=True;
  128. X  
  129. X!     left_point= p;
  130. X!     moved_point= q;
  131. X!      switch(type)
  132. X!     { case O_POLYLINE:
  133. X!         line=(F_line *) obj;
  134. X          init_linepointmoving(line);
  135. X!         break;
  136. X!       case O_SPLINE:
  137. X!         spline=(F_spline *) obj;
  138. X          init_splinepointmoving(spline);
  139. X!         break;
  140. X!       case O_ELLIPSE:
  141. X!         movedpoint_num=(int) p; /* stored in F_point */
  142. X!         ellipse=(F_ellipse *) obj;
  143. X          if (!init_ellipsepointmoving(ellipse))    /* selected center, ignore */
  144. X          Ok=False;
  145. X!         break;
  146. X!       case O_ARC:
  147. X!         movedpoint_num=(int) p; /* stored in F_point */
  148. X!         arc=(F_arc *) obj;
  149. X          init_arcpointmoving(arc);
  150. X!         break;
  151. X!     default: 
  152. X          return;
  153. X!         break;
  154. X!     }
  155. X      if (Ok)        /* movepoint went ok */
  156. X          {
  157. X          canvas_leftbut_proc = canvas_rightbut_proc = null_proc;
  158. X***************
  159. X*** 309,325 ****
  160. X      switch (movedpoint_num) {
  161. X          case 0 :
  162. X          pw_vector(canvas_win, cur_x, cur_y, 
  163. X!             arc->point[1].x, arc->point[1].y, op, 1, SOLID_LINE, 0.0);
  164. X          break;
  165. X          case 1 :
  166. X          pw_vector(canvas_win, arc->point[0].x, arc->point[0].y,
  167. X!             cur_x, cur_y, op, 1, SOLID_LINE, 0.0);
  168. X          pw_vector(canvas_win, arc->point[2].x, arc->point[2].y,
  169. X!             cur_x, cur_y, op, 1, SOLID_LINE, 0.0);
  170. X          break;
  171. X          default :
  172. X          pw_vector(canvas_win, arc->point[2].x, arc->point[2].y,
  173. X!             cur_x, cur_y, op, 1, SOLID_LINE, 0.0);
  174. X          }
  175. X      }
  176. X  
  177. X--- 320,336 ----
  178. X      switch (movedpoint_num) {
  179. X          case 0 :
  180. X          pw_vector(canvas_win, cur_x, cur_y, 
  181. X!             arc->point[1].x, arc->point[1].y, op, 1, RUBBER_LINE, 0.0);
  182. X          break;
  183. X          case 1 :
  184. X          pw_vector(canvas_win, arc->point[0].x, arc->point[0].y,
  185. X!             cur_x, cur_y, op, 1, RUBBER_LINE, 0.0);
  186. X          pw_vector(canvas_win, arc->point[2].x, arc->point[2].y,
  187. X!             cur_x, cur_y, op, 1, RUBBER_LINE, 0.0);
  188. X          break;
  189. X          default :
  190. X          pw_vector(canvas_win, arc->point[2].x, arc->point[2].y,
  191. X!             cur_x, cur_y, op, 1, RUBBER_LINE, 0.0);
  192. X          }
  193. X      }
  194. X  
  195. X***************
  196. X*** 552,558 ****
  197. X  
  198. X      draw_pointlink(INV_PAINT);
  199. X      latex_endpoint(latex_fix_x, latex_fix_y, x, y, &cur_x, &cur_y,
  200. X!         latexarrow_mode, (magnet_mode)? 5: 1);
  201. X      draw_pointlink(INV_PAINT);
  202. X      c = (x == cur_x  &&  y == cur_y)? &null_cursor: &crosshair_cursor;
  203. X      if (c != cur_latexcursor) {
  204. X--- 563,569 ----
  205. X  
  206. X      draw_pointlink(INV_PAINT);
  207. X      latex_endpoint(latex_fix_x, latex_fix_y, x, y, &cur_x, &cur_y,
  208. X!         latexarrow_mode, (magnet_mode)? (appres.INCHES? 5:(grid2_mode? 15:3)): 1);
  209. X      draw_pointlink(INV_PAINT);
  210. X      c = (x == cur_x  &&  y == cur_y)? &null_cursor: &crosshair_cursor;
  211. X      if (c != cur_latexcursor) {
  212. X***************
  213. X*** 616,622 ****
  214. X  {
  215. X      draw_pointlink(INV_PAINT);
  216. X      latex_endpoint(latex_fix_x, latex_fix_y, x, y, &x, &y,
  217. X!         latexarrow_mode, (magnet_mode)? 5: 1);
  218. X      if (cur_latexcursor != &crosshair_cursor)
  219. X          set_temp_cursor(&crosshair_cursor);
  220. X      win_setmouseposition(canvas_win, x, y);
  221. X--- 627,633 ----
  222. X  {
  223. X      draw_pointlink(INV_PAINT);
  224. X      latex_endpoint(latex_fix_x, latex_fix_y, x, y, &x, &y,
  225. X!         latexarrow_mode, (magnet_mode)? (appres.INCHES? 5:(grid2_mode? 15:3)): 1);
  226. X      if (cur_latexcursor != &crosshair_cursor)
  227. X          set_temp_cursor(&crosshair_cursor);
  228. X      win_setmouseposition(canvas_win, x, y);
  229. X***************
  230. X*** 662,671 ****
  231. X  
  232. X      if (left_point != NULL) {
  233. X          pw_vector(canvas_win, left_point->x, left_point->y,
  234. X!             cur_x, cur_y, op, 1, SOLID_LINE, 0.0);
  235. X          }
  236. X      if ((p = moved_point->next) != NULL) {
  237. X!         pw_vector(canvas_win, p->x, p->y, cur_x, cur_y, op, 1, SOLID_LINE, 0.0);
  238. X          }
  239. X      }
  240. X  
  241. X--- 673,682 ----
  242. X  
  243. X      if (left_point != NULL) {
  244. X          pw_vector(canvas_win, left_point->x, left_point->y,
  245. X!             cur_x, cur_y, op, 1, RUBBER_LINE, 0.0);
  246. X          }
  247. X      if ((p = moved_point->next) != NULL) {
  248. X!         pw_vector(canvas_win, p->x, p->y, cur_x, cur_y, op, 1, RUBBER_LINE, 0.0);
  249. X          }
  250. X      }
  251. X  
  252. X*** @xfig.pl9/msgsw.c    Mon Apr 30 12:13:35 1990
  253. X--- ./msgsw.c    Mon Jun  3 10:55:32 1991
  254. X***************
  255. X*** 15,21 ****
  256. X  #include "paintop.h"
  257. X  #include "psfonts.h"
  258. X  
  259. X- extern int        errno;
  260. X  extern int        action_on;
  261. X  extern            null_proc();
  262. X  
  263. X--- 15,20 ----
  264. X*** @xfig.pl9/object.h    Wed Apr 11 10:56:21 1990
  265. X--- ./object.h    Mon Jun  3 11:16:32 1991
  266. X***************
  267. X*** 203,208 ****
  268. X--- 203,210 ----
  269. X  #define        SOLID_LINE        0
  270. X  #define        DASH_LINE        1
  271. X  #define        DOTTED_LINE        2
  272. X+ #define        RUBBER_LINE        3
  273. X+ #define        PANEL_LINE        4
  274. X  
  275. X  #define        CLOSED_PATH        0
  276. X  #define        OPEN_PATH        1
  277. X*** @xfig.pl9/panel.h    Wed Apr 25 09:49:47 1990
  278. X--- ./panel.h    Mon Jun  3 11:16:47 1991
  279. X***************
  280. X*** 570,572 ****
  281. X--- 570,602 ----
  282. X      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
  283. X  mpr_static(blank_ic, 32, 32, 1, blank_image);
  284. X  
  285. X+ 
  286. X+ 
  287. X+ static char zoom_image[] = {
  288. X+ 0xff,0xff,0xff,0xff,0x01,0x00,0x00,0x80,0x01,0x0f,0x00,0x80,
  289. X+ 0x03,0x08,0x00,0x80,0x01,0xe4,0x6e,0xc1,0x09,0xa2,0xaa,0x82,
  290. X+ 0x01,0xa1,0xaa,0xa2,0x21,0xef,0xae,0x82,0x01,0x00,0x00,0x90,
  291. X+ 0x81,0x00,0x00,0x80,0x01,0x00,0x00,0x88,0x01,0x02,0x00,0x80,
  292. X+ 0x01,0x00,0x00,0x84,0x01,0x08,0x00,0x80,0x01,0x00,0x00,0x82,
  293. X+ 0x01,0x20,0x00,0x80,0x01,0x40,0x55,0x81,0x01,0x00,0x00,0x80,
  294. X+ 0x01,0x40,0x00,0x81,0x01,0x00,0x00,0x80,0x01,0x40,0x00,0x81,
  295. X+ 0x01,0x00,0x00,0x80,0x01,0x40,0x00,0x81,0x01,0x00,0x00,0x80,
  296. X+ 0x01,0x40,0x55,0x81,0x01,0x10,0x00,0x80,0x01,0x04,0x00,0x84,
  297. X+ 0x01,0x01,0x00,0x80,0x41,0x00,0x00,0x90,0x11,0x00,0x00,0x80,
  298. X+ 0x05,0x00,0x00,0xc0,0xff,0xff,0xff,0xff};
  299. X+ mpr_static(zoom_ic, 32, 32, 1, zoom_image);
  300. X+ 
  301. X+ 
  302. X+ static char pan_image[] = {
  303. X+ 0x00,0x00,0x00,0x00,0x00,0x00,0x1c,0x00,0x00,0x00,0x24,0x00,
  304. X+ 0x00,0x00,0x24,0x00,0x00,0x40,0x9c,0x2b,0x00,0xe0,0x44,0x5a,
  305. X+ 0x00,0x50,0x45,0x4a,0x00,0x40,0xc4,0x4b,0x00,0x40,0x00,0x00,
  306. X+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0x1f,0x00,
  307. X+ 0x00,0x01,0x10,0x00,0x00,0x01,0x10,0x00,0x00,0x01,0x10,0x00,
  308. X+ 0x08,0x01,0x10,0x02,0x04,0x01,0x10,0x04,0x3e,0x01,0x90,0x0f,
  309. X+ 0x04,0x01,0x10,0x04,0x08,0x01,0x10,0x02,0x00,0x01,0x10,0x00,
  310. X+ 0x00,0x01,0x10,0x00,0x00,0x01,0x10,0x00,0x00,0xff,0x1f,0x00,
  311. X+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x00,0x00,
  312. X+ 0x00,0x40,0x00,0x00,0x00,0x50,0x01,0x00,0x00,0xe0,0x00,0x00,
  313. X+ 0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00};
  314. X+ mpr_static(pan_ic, 32, 32, 1, pan_image);
  315. X*** @xfig.pl9/patchlevel.h    Fri Jun 29 09:14:55 1990
  316. X--- ./patchlevel.h    Mon Jun  3 10:56:21 1991
  317. X***************
  318. X*** 1 ****
  319. X! #define PATCHLEVEL 9
  320. X--- 1 ----
  321. X! #define PATCHLEVEL 10
  322. X*** @xfig.pl9/popup.c    Thu Sep 20 16:39:55 1990
  323. X--- ./popup.c    Wed Jun 12 11:33:46 1991
  324. X***************
  325. X*** 18,23 ****
  326. X--- 18,24 ----
  327. X  extern char    current_file[];
  328. X  extern int    cur_command;
  329. X  extern char    cut_buf_name[];
  330. X+ extern int    action_on;
  331. X  
  332. X  extern        put_msg();
  333. X  extern        init_msg_receiving();
  334. X***************
  335. X*** 172,178 ****
  336. X      int            menu_code = (int)mi->info;
  337. X  
  338. X      if (cur_command == F_TEXT)
  339. X!         finish_text_input();
  340. X      /* char_handler(CR); */    /* old method */
  341. X  
  342. X      switch(menu_code) {
  343. X--- 173,179 ----
  344. X      int            menu_code = (int)mi->info;
  345. X  
  346. X      if (cur_command == F_TEXT)
  347. X!         save_finish_text_input();
  348. X      /* char_handler(CR); */    /* old method */
  349. X  
  350. X      switch(menu_code) {
  351. X***************
  352. X*** 240,247 ****
  353. X      XtPopdown(menu);
  354. X      }
  355. X  
  356. X  quit()
  357. X! {
  358. X      /* delete the cut buffer only if it is a temporary file */
  359. X      if(strncmp(cut_buf_name, "/tmp",4) == 0)
  360. X          unlink(cut_buf_name);
  361. X--- 241,262 ----
  362. X      XtPopdown(menu);
  363. X      }
  364. X  
  365. X+ /* finish text input saving figure_modified flag first.  finish_text_input()
  366. X+    always sets the figure_modified flag, but if we weren't actually inputting
  367. X+    text then we don't want to set the flag */
  368. X+ 
  369. X+ save_finish_text_input()
  370. X+     {
  371. X+     int save_modified_flag = figure_modified;
  372. X+ 
  373. X+     if (! action_on)
  374. X+         return;        /* weren't actually inputting text */
  375. X+     finish_text_input();
  376. X+     figure_modified = save_modified_flag;
  377. X+     }
  378. X+     
  379. X  quit()
  380. X!     {
  381. X      /* delete the cut buffer only if it is a temporary file */
  382. X      if(strncmp(cut_buf_name, "/tmp",4) == 0)
  383. X          unlink(cut_buf_name);
  384. X*** @xfig.pl9/printfonts.c    Thu Apr 12 15:47:46 1990
  385. X--- ./printfonts.c    Fri Jun 14 14:20:42 1991
  386. X***************
  387. X*** 137,148 ****
  388. X--- 137,162 ----
  389. X  setup_fontmenu()
  390. X      {
  391. X      register int    i;
  392. X+     Pixel        bg,fg;
  393. X+     Arg        args[2];
  394. X  
  395. X      /* Create the bitmaps */
  396. X  
  397. X+ /* OpenWindows bug doesn't handle the one-plane bitmap on a multi-plane display */
  398. X+ #ifdef OPENWIN
  399. X+     XtSetArg(args[0], XtNforeground, &fg);    /* get the foreground/background of the widget */
  400. X+     XtSetArg(args[1], XtNbackground, &bg);
  401. X+     XtGetValues(fontpane[0], args, TWO);
  402. X+ 
  403. X      for (i=0; i<NUMFONTS; i++)
  404. X+         font_menu_bitmaps[i] = XCreatePixmapFromBitmapData(tool_d,XtWindow(psfont),
  405. X+         font_menu_bits[i], FONT_PANE_WIDTH, FONT_PANE_HEIGHT, fg, bg, 
  406. X+         XDefaultDepthOfScreen(tool_s));
  407. X+ #else
  408. X+     for (i=0; i<NUMFONTS; i++)
  409. X          font_menu_bitmaps[i] = XCreateBitmapFromData(tool_d,XtWindow(psfont),
  410. X          font_menu_bits[i], FONT_PANE_WIDTH, FONT_PANE_HEIGHT);
  411. X+ #endif
  412. X      psfont_args[6].value = (XtArgVal) font_menu_bitmaps[0];
  413. X      XtSetValues(psfont, &psfont_args[6], 1);    /* show default font in window */
  414. X  
  415. X*** @xfig.pl9/read.c    Fri Jul  6 10:48:42 1990
  416. X--- ./read.c    Mon Jun  3 11:43:39 1991
  417. X***************
  418. X*** 15,21 ****
  419. X  
  420. X  extern F_arrow        *make_arrow();
  421. X  extern char        *calloc();
  422. X- extern int        errno;
  423. X  
  424. X  static F_ellipse    *read_ellipseobject();
  425. X  static F_line        *read_lineobject();
  426. X--- 15,20 ----
  427. X***************
  428. X*** 35,42 ****
  429. X  char    *file;
  430. X  int    err;
  431. X  {
  432. X-     extern char    *sys_errlist[];
  433. X- 
  434. X      if (err == 0)        /* Successful read */
  435. X          return;
  436. X  #ifdef ENAMETOOLONG
  437. X--- 34,39 ----
  438. X***************
  439. X*** 675,681 ****
  440. X      if (n != 13 && n != 14) {
  441. X          put_msg(Err_incomp, "text", line_no);
  442. X          free((char*)t);
  443. X!         /* return(NULL); */
  444. X          }
  445. X      if (n == 13) {
  446. X        /* Read in the remainder of the text object. */
  447. X--- 672,678 ----
  448. X      if (n != 13 && n != 14) {
  449. X          put_msg(Err_incomp, "text", line_no);
  450. X          free((char*)t);
  451. X!         return(NULL);
  452. X          }
  453. X      if (n == 13) {
  454. X        /* Read in the remainder of the text object. */
  455. X*** @xfig.pl9/read1_3.c    Tue May  1 16:40:17 1990
  456. X--- ./read1_3.c    Mon Jun  3 10:55:54 1991
  457. X***************
  458. X*** 30,39 ****
  459. X  #define            DRAW_COMPOUND        13
  460. X  
  461. X  extern F_arrow        *forward_arrow(), *backward_arrow();
  462. X- extern int        errno;
  463. X- extern char        *sys_errlist[];
  464. X- extern int        sys_nerr, errno;
  465. X- 
  466. X  static F_ellipse    *read_1_3_ellipseobject();
  467. X  static F_line        *read_1_3_lineobject();
  468. X  static F_text        *read_1_3_textobject();
  469. X--- 30,35 ----
  470. X*** @xfig.pl9/redisplay.c    Thu Apr 26 10:21:44 1990
  471. X--- ./redisplay.c    Mon Jun  3 12:03:15 1991
  472. X***************
  473. X*** 4,9 ****
  474. X--- 4,11 ----
  475. X   *    Copyright (c) 1988 by Supoj Sutanthavibul (supoj@sally.UTEXAS.EDU)
  476. X   *    Febuary 1988.
  477. X   *
  478. X+  *    Depth code by Mike Lutz 1991
  479. X+  *
  480. X   *    %W%    %G%
  481. X  */
  482. X  #include "fig.h"
  483. X***************
  484. X*** 15,136 ****
  485. X  extern int        compoundbox_shown;
  486. X  extern int        foreground_color, background_color;
  487. X  
  488. X  redisplay_objects(objects)
  489. X  F_compound    *objects;
  490. X! {
  491. X!     int fill;
  492. X  
  493. X!     if (objects == NULL) 
  494. X!         return;
  495. X      for (fill=1; fill >= 0; fill--)
  496. X!         {
  497. X!         redisplay_arcobject(objects->arcs,fill);
  498. X!         redisplay_compoundobject(objects->compounds,fill);
  499. X!         redisplay_ellipseobject(objects->ellipses,fill);
  500. X!         redisplay_lineobject(objects->lines,fill);
  501. X!         redisplay_splineobject(objects->splines,fill);
  502. X!         }
  503. X!     if (pointmarker_shown)    /* show the point markers if they are on */
  504. X!         toggle_pointmarker();
  505. X!     if (compoundbox_shown) {
  506. X!         F_compound    *c;
  507. X!         for (c = objects->compounds; c != NULL; c = c->next)
  508. X!         draw_compoundbox(c, INV_PAINT);    /* show the compound boxes */
  509. X          }
  510. X      /* text doesn't have fill mode */
  511. X!     redisplay_textobject(objects->texts);
  512. X      }
  513. X  
  514. X! redisplay_arcobject(arcs,fill)
  515. X  F_arc    *arcs;
  516. X! int fill;
  517. X! {
  518. X!     F_arc    *arc;
  519. X  
  520. X!     for (arc = arcs; arc != NULL; arc = arc->next)
  521. X          {
  522. X!         if ((fill && arc->area_fill) ||
  523. X!             (fill==0 && arc->area_fill == 0))
  524. X!             draw_arc(arc, foreground_color);
  525. X          }
  526. X      }
  527. X  
  528. X! redisplay_ellipseobject(ellipses,fill)
  529. X  F_ellipse    *ellipses;
  530. X  int fill;
  531. X! {
  532. X!     F_ellipse    *e;
  533. X  
  534. X!     for (e = ellipses; e != NULL; e = e->next)
  535. X          {
  536. X!         if ((fill && e->area_fill) ||
  537. X!             (fill==0 && e->area_fill == 0))
  538. X!             draw_ellipse(e, foreground_color);
  539. X          }
  540. X      }
  541. X  
  542. X! redisplay_lineobject(lines,fill)
  543. X  F_line    *lines;
  544. X  int fill;
  545. X! {
  546. X!     F_line    *line;
  547. X  
  548. X!     for (line = lines; line != NULL; line = line->next) 
  549. X          {
  550. X!         if ((fill && line->area_fill) ||
  551. X!             (fill==0 && line->area_fill == 0))
  552. X!             draw_line(line, PAINT);
  553. X          }
  554. X      }
  555. X  
  556. X! redisplay_splineobject(splines,fill)
  557. X  F_spline    *splines;
  558. X  int fill;
  559. X! {
  560. X!     F_spline    *s;
  561. X! 
  562. X!     for (s = splines; s != NULL; s = s->next)
  563. X          {
  564. X!         if ((fill && s->area_fill) ||
  565. X!             (fill==0 && s->area_fill == 0))
  566. X!             draw_spline(s, PAINT);
  567. X          }
  568. X      }
  569. X  
  570. X! redisplay_textobject(texts)
  571. X! F_text    *texts;
  572. X! {
  573. X!     F_text    *t;
  574. X  
  575. X!     for (t = texts; t != NULL; t = t->next)
  576. X!         draw_text(t, PAINT);
  577. X      }
  578. X  
  579. X! redisplay_compoundobject(compounds,fill)
  580. X  F_compound    *compounds;
  581. X! int fill;
  582. X  {
  583. X      F_compound    *c;
  584. X  
  585. X      for(c = compounds; c != NULL; c = c->next) {
  586. X!         redisplay_arcobject(c->arcs,fill);
  587. X!         redisplay_compoundobject(c->compounds,fill);
  588. X!         redisplay_ellipseobject(c->ellipses,fill);
  589. X!         redisplay_lineobject(c->lines,fill);
  590. X!         redisplay_splineobject(c->splines,fill);
  591. X  
  592. X          /* no filled text mode, just do text on non-filled pass */
  593. X          if(fill==0) {
  594. X!             redisplay_textobject(c->texts);
  595. X              }
  596. X          }
  597. X      }
  598. X  
  599. X  redisplay_canvas()
  600. X  {
  601. X      extern F_compound    objects;
  602. X  
  603. X      clear_canvas();
  604. X      set_temp_cursor(&wait_cursor);
  605. X      redisplay_objects(&objects);
  606. X      redisplay_grid();
  607. X--- 17,467 ----
  608. X  extern int        compoundbox_shown;
  609. X  extern int        foreground_color, background_color;
  610. X  
  611. X+ /*
  612. X+  * Support for rendering based on correct object depth.  A simple
  613. X+  * depth based caching scheme; anything more will require major
  614. X+  * surgery on the object data structures that will percolate throughout
  615. X+  * program.
  616. X+  */
  617. X+ 
  618. X+ #define    MAXDEPTH    (10)
  619. X+ 
  620. X+ /*
  621. X+  * One ``counts'' structure for each object type at each nesting depth from
  622. X+  * 0 to MAXDEPTH - 1.  We track both the number of objects per type per depth,
  623. X+  * as well as the number of objects drawn so far per type per depth to cut down
  624. X+  * on search loop overhead.
  625. X+  */
  626. X+ 
  627. X+ struct counts
  628. X+     {
  629. X+     unsigned    num_arcs ;    /* # arcs at this depth */
  630. X+     unsigned    num_lines ;    /* # lines at this depth */
  631. X+     unsigned    num_ellipses ;    /* # ellipses at this depth */
  632. X+     unsigned    num_splines ;    /* # splines at this depth */
  633. X+     unsigned    num_texts ;    /* # texts at this depth */
  634. X+     unsigned    cnt_arcs ;    /* count of arcs drawn at this depth */
  635. X+     unsigned    cnt_lines ;    /* count of lines drawn at this depth */
  636. X+     unsigned    cnt_ellipses ;    /* count of ellipses drawn at this depth */
  637. X+     unsigned    cnt_splines ;    /* count of splines drawn at this depth */
  638. X+     unsigned    cnt_texts ;    /* count of texts drawn at this depth */
  639. X+     } ;
  640. X+ 
  641. X+ /*
  642. X+  * The array of ``counts'' structures.  All objects at depth >= MAXDEPTH
  643. X+  * are accounted for in the counts[MAXDEPTH] entry.
  644. X+  */
  645. X+ 
  646. X+ struct counts counts[MAXDEPTH + 1] ;
  647. X+ 
  648. X+ /*
  649. X+  * Minimum and maximum functions.
  650. X+  */
  651. X+ 
  652. X+ static int imin(x, y)
  653. X+ int x ;
  654. X+ int y ;
  655. X+     {
  656. X+     return (x <= y) ? x : y ;
  657. X+     }
  658. X+ 
  659. X+ static int imax(x, y)
  660. X+ int x ;
  661. X+ int y ;
  662. X+     {
  663. X+     return (x >= y) ? x : y ;
  664. X+     }
  665. X+ 
  666. X+ /*
  667. X+  * Function to clear the array of object counts prior to each redraw.
  668. X+  */
  669. X+ 
  670. X+ static void clearcounts()
  671. X+     {
  672. X+     register struct counts *cp ;
  673. X+ 
  674. X+     for (cp = &counts[0] ; cp <= &counts[MAXDEPTH] ; ++cp)
  675. X+     {
  676. X+     cp->num_arcs = 0 ;
  677. X+     cp->num_lines = 0 ;
  678. X+     cp->num_ellipses = 0 ;
  679. X+     cp->num_splines = 0 ;
  680. X+     cp->num_texts = 0 ;
  681. X+     cp->cnt_arcs = 0 ;
  682. X+     cp->cnt_lines = 0 ;
  683. X+     cp->cnt_ellipses = 0 ;
  684. X+     cp->cnt_splines = 0 ;
  685. X+     cp->cnt_texts = 0 ;
  686. X+     }
  687. X+     }
  688. X+ 
  689. X+ unsigned int        max_depth;
  690. X+ static    int        this_depth;
  691. X+ 
  692. X  redisplay_objects(objects)
  693. X  F_compound    *objects;
  694. X!     {
  695. X!     int fill;
  696. X!     int depth ;
  697. X!     
  698. X!     if (objects == NULL) 
  699. X!     return;
  700. X  
  701. X!     /*
  702. X!      * Clear object counts, and then get the max. depth of any object
  703. X!      * from the max. depths of each object type in the top level compound.
  704. X!      */
  705. X! 
  706. X!     clearcounts() ;
  707. X!     max_depth = imax(arc_depths(objects->arcs),
  708. X!              imax(line_depths(objects->lines),
  709. X!               imax(ellipse_depths(objects->ellipses),
  710. X!                    imax(compound_depths(objects->compounds),
  711. X!                     imax(text_depths(objects->texts),
  712. X!                      spline_depths(objects->splines)))))) ;
  713. X! 
  714. X!     /*
  715. X!      * A new outer loop, executing once per depth level from max_depth
  716. X!      * down to 0 (negative depths are not supported).  The code inside
  717. X!      * the loop is the original code for redisplay_objects.
  718. X!      */
  719. X! 
  720. X!     for (depth = max_depth ; depth >= 0 ; --depth)
  721. X!     {
  722. X      for (fill=1; fill >= 0; fill--)
  723. X!         {
  724. X!         redisplay_arcobject(objects->arcs, depth, fill);
  725. X!         redisplay_compoundobject(objects->compounds, depth, fill);
  726. X!         redisplay_ellipseobject(objects->ellipses, depth, fill);
  727. X!         redisplay_lineobject(objects->lines, depth, fill);
  728. X!         redisplay_splineobject(objects->splines, depth, fill);
  729. X          }
  730. X      /* text doesn't have fill mode */
  731. X!     redisplay_textobject(objects->texts, depth);
  732. X      }
  733. X  
  734. X!     /*
  735. X!      * Point markers and compounds, not being ``real objects'', are handled
  736. X!      * outside the depth loop.
  737. X!      */
  738. X! 
  739. X!     if (pointmarker_shown)    /* show the point markers if they are on */
  740. X!     toggle_pointmarker();
  741. X!     if (compoundbox_shown)
  742. X!     {
  743. X!     F_compound    *c;
  744. X!     for (c = objects->compounds; c != NULL; c = c->next)
  745. X!         draw_compoundbox(c, INV_PAINT);    /* show the compound boxes */
  746. X!     }
  747. X!     }
  748. X! 
  749. X! /*
  750. X!  * Find the maximum depth of any arc, recording the number of arcs per
  751. X!  * each level along the way.
  752. X!  */
  753. X! 
  754. X! int arc_depths(arcs)
  755. X  F_arc    *arcs;
  756. X!     {
  757. X!     int    maxdepth     = 0 ;
  758. X!     F_arc        *fp ;
  759. X  
  760. X!     for (fp = arcs ; fp != NULL ; fp = fp->next )
  761. X!     {
  762. X!     if (maxdepth < fp->depth)
  763. X!         maxdepth = fp->depth ;
  764. X! 
  765. X!     ++counts[imin(fp->depth, MAXDEPTH)].num_arcs ;
  766. X!     }
  767. X!     return maxdepth ;
  768. X!     }
  769. X! 
  770. X! /*
  771. X!  * Find the maximum depth of any line, recording the number of lines per
  772. X!  * each level along the way.
  773. X!  */
  774. X! 
  775. X! int line_depths(lines)
  776. X! F_line    *lines;
  777. X!     {
  778. X!     int    maxdepth     = 0 ;
  779. X!     F_line        *fp ;
  780. X! 
  781. X!     for (fp = lines ; fp != NULL ; fp = fp->next )
  782. X!     {
  783. X!     if (maxdepth < fp->depth)
  784. X!         maxdepth = fp->depth ;
  785. X! 
  786. X!     ++counts[imin(fp->depth, MAXDEPTH)].num_lines ;
  787. X!     }
  788. X!     return maxdepth ;
  789. X!     }
  790. X! 
  791. X! /*
  792. X!  * Find the maximum depth of any ellipse, recording the number of ellipses
  793. X!  * per each level along the way.
  794. X!  */
  795. X! 
  796. X! int ellipse_depths(ellipses)
  797. X! F_ellipse    *ellipses;
  798. X!     {
  799. X!     int    maxdepth     = 0 ;
  800. X!     F_ellipse        *fp ;
  801. X! 
  802. X!     for (fp = ellipses ; fp != NULL ; fp = fp->next )
  803. X!     {
  804. X!     if (maxdepth < fp->depth)
  805. X!         maxdepth = fp->depth ;
  806. X! 
  807. X!     ++counts[imin(fp->depth, MAXDEPTH)].num_ellipses ;
  808. X!     }
  809. X!     return maxdepth ;
  810. X!     }
  811. X! 
  812. X! /*
  813. X!  * Find the maximum depth of any spline, recording the number of splines
  814. X!  * per each level along the way.
  815. X!  */
  816. X! 
  817. X! int spline_depths(splines)
  818. X! F_spline    *splines;
  819. X!     {
  820. X!     int    maxdepth     = 0 ;
  821. X!     F_spline        *fp ;
  822. X! 
  823. X!     for (fp = splines ; fp != NULL ; fp = fp->next )
  824. X!     {
  825. X!     if (maxdepth < fp->depth)
  826. X!         maxdepth = fp->depth ;
  827. X! 
  828. X!     ++counts[imin(fp->depth, MAXDEPTH)].num_splines ;
  829. X!     }
  830. X!     return maxdepth ;
  831. X!     }
  832. X! 
  833. X! /*
  834. X!  * Find the maximum depth of any text, recording the number of texts
  835. X!  * per each level along the way.
  836. X!  */
  837. X! 
  838. X! int text_depths(texts)
  839. X! F_text    *texts;
  840. X!     {
  841. X!     int    maxdepth     = 0 ;
  842. X!     F_text        *fp ;
  843. X! 
  844. X!     for (fp = texts ; fp != NULL ; fp = fp->next )
  845. X!     {
  846. X!     if (maxdepth < fp->depth)
  847. X!         maxdepth = fp->depth ;
  848. X! 
  849. X!     ++counts[imin(fp->depth, MAXDEPTH)].num_texts ;
  850. X!     }
  851. X!     return maxdepth ;
  852. X!     }
  853. X! 
  854. X! /*
  855. X!  * Find the maximum depth of any of the objects contained in the
  856. X!  * compound.
  857. X!  */
  858. X! 
  859. X! int compound_depths(compounds)
  860. X! F_compound    *compounds;
  861. X!     {
  862. X!     int    maxdepth     = 0 ;
  863. X!     F_compound        *fp ;
  864. X!     
  865. X!     for (fp = compounds ; fp != NULL ; fp = fp->next )
  866. X!     {
  867. X!     maxdepth = imax(arc_depths(fp->arcs),
  868. X!              imax(line_depths(fp->lines),
  869. X!                   imax(ellipse_depths(fp->ellipses),
  870. X!                    imax(compound_depths(fp->compounds),
  871. X!                     imax(text_depths(fp->texts),
  872. X!                          spline_depths(fp->splines)))))) ;
  873. X!     }
  874. X!     return maxdepth ;
  875. X!     }
  876. X! 
  877. X! /*
  878. X!  * Redisplay a list of arcs.  Only display arcs of the correct depth and
  879. X!  * fill mode.  For each arc drawn, update the count for the appropriate
  880. X!  * depth in the counts array.
  881. X!  */
  882. X! 
  883. X! redisplay_arcobject(arcs, depth, fill)
  884. X! F_arc    *arcs;
  885. X! int depth;
  886. X! int fill;
  887. X!     {
  888. X!     F_arc        *arc;
  889. X!     struct counts    *cp = &counts[imin(depth, MAXDEPTH)] ;
  890. X!     
  891. X!     arc = arcs ;
  892. X!     while (arc != NULL && cp->cnt_arcs < cp->num_arcs)
  893. X!     {
  894. X!     if (depth == arc->depth)
  895. X!         if ((fill && arc->area_fill) ||
  896. X!         (fill==0 && arc->area_fill == 0))
  897. X          {
  898. X!         draw_arc(arc, foreground_color) ;
  899. X!         ++cp->cnt_arcs ;
  900. X          }
  901. X+     
  902. X+     arc = arc->next ;
  903. X      }
  904. X+     }
  905. X  
  906. X! /*
  907. X!  * Redisplay a list of ellipses.  Only display ellipses of the correct
  908. X!  * depth and fill mode.  For each ellipse drawn, update the count for the
  909. X!  * appropriate depth in the counts array.
  910. X!  */
  911. X! 
  912. X! redisplay_ellipseobject(ellipses, depth, fill)
  913. X  F_ellipse    *ellipses;
  914. X+ int depth;
  915. X  int fill;
  916. X!     {
  917. X!     F_ellipse        *ep;
  918. X!     struct counts    *cp = &counts[imin(depth, MAXDEPTH)] ;
  919. X  
  920. X!     
  921. X!     ep = ellipses ;
  922. X!     while (ep != NULL && cp->cnt_ellipses < cp->num_ellipses)
  923. X!     {
  924. X!     if (depth == ep->depth)
  925. X!         if ((fill && ep->area_fill) ||
  926. X!         (fill==0 && ep->area_fill == 0))
  927. X          {
  928. X!         draw_ellipse(ep, PAINT) ;
  929. X!         ++cp->cnt_ellipses ;
  930. X          }
  931. X+     
  932. X+     ep = ep->next ;
  933. X      }
  934. X+     }
  935. X  
  936. X! /*
  937. X!  * Redisplay a list of lines.  Only display lines of the correct
  938. X!  * depth and fill mode.  For each line drawn, update the count for the
  939. X!  * appropriate depth in the counts array.
  940. X!  */
  941. X! 
  942. X! redisplay_lineobject(lines, depth, fill)
  943. X  F_line    *lines;
  944. X+ int depth;
  945. X  int fill;
  946. X!     {
  947. X!     F_line        *lp;
  948. X!     struct counts    *cp = &counts[imin(depth, MAXDEPTH)] ;
  949. X!     
  950. X  
  951. X!     lp = lines ;
  952. X!     while (lp != NULL && cp->cnt_lines < cp->num_lines)
  953. X!     {
  954. X!     if (depth == lp->depth)
  955. X!         if ((fill && lp->area_fill) ||
  956. X!         (fill==0 && lp->area_fill == 0))
  957. X          {
  958. X!         draw_line(lp, PAINT) ;
  959. X!         ++cp->cnt_lines ;
  960. X          }
  961. X+     
  962. X+     lp = lp->next ;
  963. X      }
  964. X+     }
  965. X  
  966. X! /*
  967. X!  * Redisplay a list of splines.  Only display splines of the correct
  968. X!  * depth and fill mode.  For each spline drawn, update the count for the
  969. X!  * appropriate depth in the counts array.
  970. X!  */
  971. X! 
  972. X! redisplay_splineobject(splines, depth, fill)
  973. X  F_spline    *splines;
  974. X+ int depth;
  975. X  int fill;
  976. X!     {
  977. X!     F_spline        *spline;
  978. X!     struct counts    *cp = &counts[imin(depth, MAXDEPTH)] ;
  979. X!     
  980. X!     spline = splines ;
  981. X!     while (spline != NULL && cp->cnt_splines < cp->num_splines)
  982. X!     {
  983. X!     if (depth == spline->depth)
  984. X!         if ((fill && spline->area_fill) ||
  985. X!         (fill==0 && spline->area_fill == 0))
  986. X          {
  987. X!         draw_spline(spline, PAINT) ;
  988. X!         ++cp->cnt_splines ;
  989. X          }
  990. X+     
  991. X+     spline = spline->next ;
  992. X      }
  993. X+     }
  994. X  
  995. X! /*
  996. X!  * Redisplay a list of texts.  Only display texts of the correct
  997. X!  * depth.  For each text drawn, update the count for the appropriate
  998. X!  * depth in the counts array.
  999. X!  */
  1000. X  
  1001. X! redisplay_textobject(texts, depth)
  1002. X! F_text    *texts;
  1003. X! int depth;
  1004. X!     {
  1005. X!     F_text        *text;
  1006. X!     struct counts    *cp = &counts[imin(depth, MAXDEPTH)] ;
  1007. X!     
  1008. X!     text = texts ;
  1009. X!     while (text != NULL && cp->cnt_texts < cp->num_texts)
  1010. X!     {
  1011. X!     if (depth == text->depth)
  1012. X!         {
  1013. X!         draw_text(text, PAINT) ;
  1014. X!         ++cp->cnt_texts ;
  1015. X!         }
  1016. X!     
  1017. X!     text = text->next ;
  1018. X      }
  1019. X+     }
  1020. X  
  1021. X! /*
  1022. X!  * Redisplay a list of compounds at a current depth.  Basically
  1023. X!  * just farm the work out to the objects contained in the compound.
  1024. X!  */
  1025. X! 
  1026. X! redisplay_compoundobject(compounds, depth, fill)
  1027. X  F_compound    *compounds;
  1028. X! int depth ;
  1029. X! int fill ;
  1030. X  {
  1031. X      F_compound    *c;
  1032. X  
  1033. X      for(c = compounds; c != NULL; c = c->next) {
  1034. X!         redisplay_arcobject(c->arcs, depth, fill);
  1035. X!         redisplay_compoundobject(c->compounds, depth, fill);
  1036. X!         redisplay_ellipseobject(c->ellipses, depth, fill);
  1037. X!         redisplay_lineobject(c->lines, depth, fill);
  1038. X!         redisplay_splineobject(c->splines, depth, fill);
  1039. X  
  1040. X          /* no filled text mode, just do text on non-filled pass */
  1041. X          if(fill==0) {
  1042. X!             redisplay_textobject(c->texts, depth);
  1043. X              }
  1044. X          }
  1045. X      }
  1046. X  
  1047. X+ /*
  1048. X+  * Redisplay the entire drawing.
  1049. X+  */
  1050. X  redisplay_canvas()
  1051. X  {
  1052. X      extern F_compound    objects;
  1053. X  
  1054. X      clear_canvas();
  1055. X+     
  1056. X      set_temp_cursor(&wait_cursor);
  1057. X      redisplay_objects(&objects);
  1058. X      redisplay_grid();
  1059. X*** @xfig.pl9/remove.c    Mon Apr 30 12:13:37 1990
  1060. X--- ./remove.c    Mon Jun  3 11:28:19 1991
  1061. X***************
  1062. X*** 13,20 ****
  1063. X  #include "object.h"
  1064. X  #include "paintop.h"
  1065. X  
  1066. X- #define            TOLERANCE    7
  1067. X- 
  1068. X  extern            (*canvas_kbd_proc)();
  1069. X  extern            (*canvas_locmove_proc)();
  1070. X  extern            (*canvas_leftbut_proc)();
  1071. X--- 13,18 ----
  1072. X***************
  1073. X*** 24,53 ****
  1074. X  extern            set_popupmenu();
  1075. X  
  1076. X  
  1077. X  extern int        foreground_color, background_color;
  1078. X  
  1079. X  extern int        init_remove();
  1080. X  
  1081. X  remove_selected()
  1082. X  {
  1083. X      canvas_kbd_proc = null_proc;
  1084. X      canvas_locmove_proc = null_proc;
  1085. X!     canvas_leftbut_proc = init_remove;
  1086. X      canvas_middlebut_proc = null_proc;
  1087. X      canvas_rightbut_proc = set_popupmenu;
  1088. X      set_cursor(&buster_cursor);
  1089. X      }
  1090. X  
  1091. X! init_remove(x, y)
  1092. X  int    x, y;
  1093. X  {
  1094. X-     extern F_line        *line_search();
  1095. X-     extern F_arc        *arc_search();
  1096. X-     extern F_ellipse    *ellipse_search();
  1097. X-     extern F_text        *text_search();
  1098. X-     extern F_spline        *spline_search();
  1099. X-     extern F_compound    *compound_search();
  1100. X-     extern F_compound    objects;
  1101. X      F_line        *l;
  1102. X      F_arc        *a;
  1103. X      F_ellipse    *e;
  1104. X--- 22,51 ----
  1105. X  extern            set_popupmenu();
  1106. X  
  1107. X  
  1108. X+ extern    F_compound    objects;
  1109. X  extern int        foreground_color, background_color;
  1110. X  
  1111. X  extern int        init_remove();
  1112. X  
  1113. X+ extern int        init_object_search();
  1114. X+ extern int        object_search();
  1115. X+ 
  1116. X  remove_selected()
  1117. X  {
  1118. X      canvas_kbd_proc = null_proc;
  1119. X      canvas_locmove_proc = null_proc;
  1120. X!     init_object_search(init_remove);
  1121. X!     canvas_leftbut_proc = object_search;
  1122. X      canvas_middlebut_proc = null_proc;
  1123. X      canvas_rightbut_proc = set_popupmenu;
  1124. X      set_cursor(&buster_cursor);
  1125. X      }
  1126. X  
  1127. X! init_remove(p,type,x, y)
  1128. X! char *p;
  1129. X! int type;
  1130. X  int    x, y;
  1131. X  {
  1132. X      F_line        *l;
  1133. X      F_arc        *a;
  1134. X      F_ellipse    *e;
  1135. X***************
  1136. X*** 54,62 ****
  1137. X      F_text        *t;
  1138. X      F_spline    *s;
  1139. X      F_compound    *c;
  1140. X-     int        dummy;
  1141. X  
  1142. X!     if ((c = compound_search(x, y, TOLERANCE, &dummy, &dummy)) != NULL) {
  1143. X          draw_compoundbox(c, INV_PAINT);
  1144. X          erase_compound(c);
  1145. X          delete_compound(&objects.compounds, c);
  1146. X--- 52,61 ----
  1147. X      F_text        *t;
  1148. X      F_spline    *s;
  1149. X      F_compound    *c;
  1150. X  
  1151. X!     switch(type)
  1152. X!     { case O_COMPOUND:
  1153. X!         c=(F_compound *) p;
  1154. X          draw_compoundbox(c, INV_PAINT);
  1155. X          erase_compound(c);
  1156. X          delete_compound(&objects.compounds, c);
  1157. X***************
  1158. X*** 64,71 ****
  1159. X          set_action_object(F_REMOVE, O_COMPOUND);
  1160. X          set_latestcompound(c);
  1161. X          set_modifiedflag();
  1162. X!         }
  1163. X!     else if ((l = line_search(x, y, TOLERANCE, &dummy, &dummy)) != NULL) {
  1164. X          toggle_linepointmarker(l);
  1165. X          draw_line(l, ERASE);
  1166. X          delete_line(&objects.lines, l);
  1167. X--- 63,71 ----
  1168. X          set_action_object(F_REMOVE, O_COMPOUND);
  1169. X          set_latestcompound(c);
  1170. X          set_modifiedflag();
  1171. X!         break;
  1172. X!       case O_POLYLINE:
  1173. X!         l=(F_line *) p;
  1174. X          toggle_linepointmarker(l);
  1175. X          draw_line(l, ERASE);
  1176. X          delete_line(&objects.lines, l);
  1177. X***************
  1178. X*** 73,88 ****
  1179. X          set_action_object(F_REMOVE, O_POLYLINE);
  1180. X          set_latestline(l);
  1181. X          set_modifiedflag();
  1182. X!         }
  1183. X!     else if ((t = text_search(x, y)) != NULL) {
  1184. X!         draw_text(t, INV_PAINT);
  1185. X          delete_text(&objects.texts, t);
  1186. X          clean_up();
  1187. X          set_action_object(F_REMOVE, O_TEXT);
  1188. X          set_latesttext(t);
  1189. X          set_modifiedflag();
  1190. X!         }
  1191. X!     else if ((e = ellipse_search(x, y, TOLERANCE, &dummy, &dummy)) != NULL){
  1192. X          toggle_ellipsepointmarker(e);
  1193. X          draw_ellipse(e, background_color);
  1194. X          delete_ellipse(&objects.ellipses, e);
  1195. X--- 73,91 ----
  1196. X          set_action_object(F_REMOVE, O_POLYLINE);
  1197. X          set_latestline(l);
  1198. X          set_modifiedflag();
  1199. X!         break;
  1200. X!       case O_TEXT:
  1201. X!         t=(F_text *) p;
  1202. X!         toggle_textpointmarker(t);
  1203. X!         draw_text(t, ERASE);
  1204. X          delete_text(&objects.texts, t);
  1205. X          clean_up();
  1206. X          set_action_object(F_REMOVE, O_TEXT);
  1207. X          set_latesttext(t);
  1208. X          set_modifiedflag();
  1209. X!         break;
  1210. X!       case O_ELLIPSE:
  1211. X!         e=(F_ellipse *) p;
  1212. X          toggle_ellipsepointmarker(e);
  1213. X          draw_ellipse(e, background_color);
  1214. X          delete_ellipse(&objects.ellipses, e);
  1215. X***************
  1216. X*** 90,97 ****
  1217. X          set_action_object(F_REMOVE, O_ELLIPSE);
  1218. X          set_latestellipse(e);
  1219. X          set_modifiedflag();
  1220. X!         }
  1221. X!     else if ((a = arc_search(x, y, TOLERANCE, &dummy, &dummy)) != NULL){
  1222. X          toggle_arcpointmarker(a);
  1223. X          draw_arc(a, background_color);
  1224. X          delete_arc(&objects.arcs, a);
  1225. X--- 93,101 ----
  1226. X          set_action_object(F_REMOVE, O_ELLIPSE);
  1227. X          set_latestellipse(e);
  1228. X          set_modifiedflag();
  1229. X!         break;
  1230. X!       case O_ARC:
  1231. X!         a=(F_arc *) p;
  1232. X          toggle_arcpointmarker(a);
  1233. X          draw_arc(a, background_color);
  1234. X          delete_arc(&objects.arcs, a);
  1235. X***************
  1236. X*** 99,106 ****
  1237. X          set_action_object(F_REMOVE, O_ARC);
  1238. X          set_latestarc(a);
  1239. X          set_modifiedflag();
  1240. X!         }
  1241. X!     else if ((s = spline_search(x, y, TOLERANCE, &dummy, &dummy)) != NULL) {
  1242. X          toggle_splinepointmarker(s);
  1243. X          draw_spline(s, ERASE);
  1244. X          delete_spline(&objects.splines, s);
  1245. X--- 103,111 ----
  1246. X          set_action_object(F_REMOVE, O_ARC);
  1247. X          set_latestarc(a);
  1248. X          set_modifiedflag();
  1249. X!         break;
  1250. X!       case O_SPLINE:
  1251. X!         s=(F_spline *) p;
  1252. X          toggle_splinepointmarker(s);
  1253. X          draw_spline(s, ERASE);
  1254. X          delete_spline(&objects.splines, s);
  1255. X***************
  1256. X*** 108,114 ****
  1257. X          set_action_object(F_REMOVE, O_SPLINE);
  1258. X          set_latestspline(s);
  1259. X          set_modifiedflag();
  1260. X!         }
  1261. X      remove_selected();
  1262. X      }
  1263. X  
  1264. X--- 113,121 ----
  1265. X          set_action_object(F_REMOVE, O_SPLINE);
  1266. X          set_latestspline(s);
  1267. X          set_modifiedflag();
  1268. X!         break;
  1269. X!       default: return;
  1270. X!       }
  1271. X      remove_selected();
  1272. X      }
  1273. X  
  1274. X***************
  1275. X*** 116,121 ****
  1276. X--- 123,129 ----
  1277. X  {
  1278. X      extern F_compound    objects;
  1279. X      extern F_compound    saved_objects;
  1280. X+     extern F_compound    object_tails;
  1281. X      extern int        last_action;
  1282. X  
  1283. X      clean_up();
  1284. X***************
  1285. X*** 132,135 ****
  1286. X--- 140,150 ----
  1287. X      objects.lines = NULL;
  1288. X      objects.splines = NULL;
  1289. X      objects.texts = NULL;
  1290. X+ 
  1291. X+     object_tails.arcs = NULL;
  1292. X+     object_tails.compounds = NULL;
  1293. X+     object_tails.ellipses = NULL;
  1294. X+     object_tails.lines = NULL;
  1295. X+     object_tails.splines = NULL;
  1296. X+     object_tails.texts = NULL;
  1297. X      }
  1298. X*** @xfig.pl9/resources.h    Mon Apr 16 11:36:11 1990
  1299. X--- ./resources.h    Mon Jun  3 11:16:50 1991
  1300. X***************
  1301. X*** 13,18 ****
  1302. X--- 13,20 ----
  1303. X  #define    EXTERN    extern
  1304. X  #endif
  1305. X  
  1306. X+ #include "zoom.h"   /* for set_marker */
  1307. X+ 
  1308. X  typedef struct
  1309. X  {
  1310. X      unsigned int    x, y, z;
  1311. X***************
  1312. X*** 53,58 ****
  1313. X--- 55,61 ----
  1314. X      char        *boldFont;
  1315. X      float        tmp_width;
  1316. X      float        tmp_height;
  1317. X+     float        startfontsize; /* ges 6.2.91 */
  1318. X  } appresStruct, *appresPtr;
  1319. X  
  1320. X  typedef struct
  1321. X***************
  1322. X*** 111,118 ****
  1323. X  typedef        MenuRec            MENU;
  1324. X  
  1325. X  #define    set_marker(win,x,y,w,h,op,pix,z1,z2) \
  1326. X!     set_line_stuff(1,SOLID_LINE,0.0,(op)); \
  1327. X!     XDrawRectangle(tool_d,(win),gccache[(op)],(x),(y),(w),(h))
  1328. X  
  1329. X  EXTERN PIXWIN        canvas_win,
  1330. X              msg_win,
  1331. X--- 114,121 ----
  1332. X  typedef        MenuRec            MENU;
  1333. X  
  1334. X  #define    set_marker(win,x,y,w,h,op,pix,z1,z2) \
  1335. X!     set_line_stuff(1,RUBBER_LINE,0.0,(op)); \
  1336. X!     zXDrawRectangle(tool_d,(win),gccache[(op)],(x),(y),(w),(h))
  1337. X  
  1338. X  EXTERN PIXWIN        canvas_win,
  1339. X              msg_win,
  1340. X*** @xfig.pl9/rotate.c    Mon Apr 30 12:13:41 1990
  1341. X--- ./rotate.c    Mon Jun  3 10:55:57 1991
  1342. X***************
  1343. X*** 148,154 ****
  1344. X          insert_ellipse(&objects.ellipses, ellipse);
  1345. X          clean_up();
  1346. X          set_action_object(F_CREATE, O_ELLIPSE);
  1347. X!         draw_ellipse(ellipse, PAINT);
  1348. X          }
  1349. X      else {
  1350. X          draw_ellipse(e, background_color);
  1351. X--- 148,154 ----
  1352. X          insert_ellipse(&objects.ellipses, ellipse);
  1353. X          clean_up();
  1354. X          set_action_object(F_CREATE, O_ELLIPSE);
  1355. X!         draw_ellipse(ellipse, foreground_color);
  1356. X          }
  1357. X      else {
  1358. X          draw_ellipse(e, background_color);
  1359. X*** @xfig.pl9/ruler.c    Thu Jul  5 13:42:49 1990
  1360. X--- ./ruler.c    Tue Jun 11 16:26:02 1991
  1361. X***************
  1362. X*** 13,18 ****
  1363. X--- 13,25 ----
  1364. X  #include "font.h"
  1365. X  #include "paintop.h"
  1366. X  
  1367. X+ /*  The following will create rulers 1.2* initial screen size, so that
  1368. X+     if the user resizes the xfig window, the rulers will have numbers there
  1369. X+     The factor can't be much larger, or the color servers for Vaxstations 
  1370. X+     screw up the pixmaps (they can't handle pixmaps much larger than 
  1371. X+     the screen) */
  1372. X+ #define            OVERFACT    1.2
  1373. X+ 
  1374. X  #define            INCH_MARK        8
  1375. X  #define            HALF_MARK        8
  1376. X  #define            QUARTER_MARK        6
  1377. X***************
  1378. X*** 33,39 ****
  1379. X  
  1380. X  static            lasty = -100;
  1381. X  static            lastx = -100;
  1382. X! static int        troffx = -7, troffy = -10;
  1383. X  static char        tr_marker_image[16] = {
  1384. X                  0xFE, 0xFF, /* *************** */
  1385. X                  0xFC, 0x7F, /*  *************  */
  1386. X--- 40,46 ----
  1387. X  
  1388. X  static            lasty = -100;
  1389. X  static            lastx = -100;
  1390. X! static int        troffx = -8, troffy = -10; /* alt: -7 */
  1391. X  static char        tr_marker_image[16] = {
  1392. X                  0xFE, 0xFF, /* *************** */
  1393. X                  0xFC, 0x7F, /*  *************  */
  1394. X***************
  1395. X*** 45,51 ****
  1396. X                  0x00, 0x01, /*        *        */
  1397. X                  };
  1398. X  static            mpr_static(trm_pr, TRM_WID, TRM_HT, 1, tr_marker_image);
  1399. X! static int        srroffx = 2, srroffy = -7;
  1400. X  static char        srr_marker_image[16] = {
  1401. X                  0x80,     /*          *  */
  1402. X                  0xC0,     /*         **  */
  1403. X--- 52,58 ----
  1404. X                  0x00, 0x01, /*        *        */
  1405. X                  };
  1406. X  static            mpr_static(trm_pr, TRM_WID, TRM_HT, 1, tr_marker_image);
  1407. X! static int        srroffx = 2, srroffy = -8; /* alt: -7 */
  1408. X  static char        srr_marker_image[16] = {
  1409. X                  0x80,     /*          *  */
  1410. X                  0xC0,     /*         **  */
  1411. X***************
  1412. X*** 66,72 ****
  1413. X                  };
  1414. X  static        mpr_static(srrm_pr, SRM_WID, SRM_HT, 1, srr_marker_image);
  1415. X  
  1416. X! static int        srloffx = -10, srloffy = -7;
  1417. X  static char        srl_marker_image[16] = {
  1418. X                  0x01,    /*  *          */
  1419. X                  0x03,    /*  **         */
  1420. X--- 73,79 ----
  1421. X                  };
  1422. X  static        mpr_static(srrm_pr, SRM_WID, SRM_HT, 1, srr_marker_image);
  1423. X  
  1424. X! static int        srloffx = -10, srloffy = -8;  /* -7 */
  1425. X  static char        srl_marker_image[16] = {
  1426. X                  0x01,    /*  *          */
  1427. X                  0x03,    /*  **         */
  1428. X***************
  1429. X*** 87,103 ****
  1430. X                  };
  1431. X  static        mpr_static(srlm_pr, SRM_WID, SRM_HT, 1, srl_marker_image);
  1432. X  
  1433. X! static Pixmap        toparrow_pm, sidearrow_pm;
  1434. X  
  1435. X  set_toprulermark(x)
  1436. X  int    x;
  1437. X  {
  1438. X!     XClearArea(tool_d, topruler_win,lastx + troffx,
  1439. X             TOPRULER_HEIGHT + troffy,trm_pr.width,
  1440. X             trm_pr.height, False);
  1441. X      XCopyArea(tool_d, toparrow_pm, topruler_win, topgc,
  1442. X          0, 0, trm_pr.width, trm_pr.height,
  1443. X!         x + troffx, TOPRULER_HEIGHT + troffy);
  1444. X      lastx = x;
  1445. X      }
  1446. X  
  1447. X--- 94,112 ----
  1448. X                  };
  1449. X  static        mpr_static(srlm_pr, SRM_WID, SRM_HT, 1, srl_marker_image);
  1450. X  
  1451. X! static Pixmap        toparrow_pm=0, sidearrow_pm=0;
  1452. X  
  1453. X+ static Pixmap topruler_pm=0, sideruler_pm=0;
  1454. X+ 
  1455. X  set_toprulermark(x)
  1456. X  int    x;
  1457. X  {
  1458. X!     XClearArea(tool_d, topruler_win,ZOOMX(lastx) + troffx,
  1459. X             TOPRULER_HEIGHT + troffy,trm_pr.width,
  1460. X             trm_pr.height, False);
  1461. X      XCopyArea(tool_d, toparrow_pm, topruler_win, topgc,
  1462. X          0, 0, trm_pr.width, trm_pr.height,
  1463. X!         ZOOMX(x) + troffx, TOPRULER_HEIGHT + troffy);
  1464. X      lastx = x;
  1465. X      }
  1466. X  
  1467. X***************
  1468. X*** 192,200 ****
  1469. X      XDefineCursor(tool_d, sideruler_win, (Cursor)bull_cursor.bitmap);
  1470. X  
  1471. X      /* top ruler, adjustments for digits are kludges based on 6x13 char */
  1472. X      p = XCreatePixmap(tool_d, topruler_win,
  1473. X!               TOPRULER_WIDTH, TOPRULER_HEIGHT,
  1474. X                DefaultDepthOfScreen(tool_s));
  1475. X  
  1476. X      XtSetArg(tmp_arg[0], XtNbackground, &bg);
  1477. X      XtSetArg(tmp_arg[1], XtNforeground, &fg);
  1478. X--- 201,212 ----
  1479. X      XDefineCursor(tool_d, sideruler_win, (Cursor)bull_cursor.bitmap);
  1480. X  
  1481. X      /* top ruler, adjustments for digits are kludges based on 6x13 char */
  1482. X+     if (topruler_pm!=NULL) XFreePixmap(tool_d, topruler_pm);
  1483. X+ 
  1484. X      p = XCreatePixmap(tool_d, topruler_win,
  1485. X!               (int)(OVERFACT*TOPRULER_WIDTH), TOPRULER_HEIGHT,
  1486. X                DefaultDepthOfScreen(tool_s));
  1487. X+     topruler_pm=p;
  1488. X  
  1489. X      XtSetArg(tmp_arg[0], XtNbackground, &bg);
  1490. X      XtSetArg(tmp_arg[1], XtNforeground, &fg);
  1491. X***************
  1492. X*** 202,208 ****
  1493. X  
  1494. X      XSetBackground(tool_d, gc, bg);
  1495. X      XSetForeground(tool_d, gc, bg);
  1496. X!     XFillRectangle(tool_d, p, gc, 0, 0, TOPRULER_WIDTH,
  1497. X              TOPRULER_HEIGHT);
  1498. X      XSetForeground(tool_d, gc, fg);
  1499. X      
  1500. X--- 214,220 ----
  1501. X  
  1502. X      XSetBackground(tool_d, gc, bg);
  1503. X      XSetForeground(tool_d, gc, bg);
  1504. X!     XFillRectangle(tool_d, p, gc, 0, 0, (int)(OVERFACT*TOPRULER_WIDTH),
  1505. X              TOPRULER_HEIGHT);
  1506. X      XSetForeground(tool_d, gc, fg);
  1507. X      
  1508. X***************
  1509. X*** 209,251 ****
  1510. X      XDrawString(tool_d, p, gc, 2, TOPRULER_HEIGHT - INCH_MARK - 3,
  1511. X              appres.INCHES ? "in" : "cm", 2);
  1512. X      if(appres.INCHES) 
  1513. X!         for (i = SINCH - 1; i <= TOPRULER_WIDTH; i += SINCH)
  1514. X          {
  1515. X          j = i + 1;
  1516. X          if (j % PIX_PER_INCH == 0)
  1517. X              {
  1518. X!             XDrawLine(tool_d, p, gc, i, TOPRULER_HEIGHT - 1, i,
  1519. X                  TOPRULER_HEIGHT - INCH_MARK - 1);
  1520. X              sprintf(number, "%d", j / PIX_PER_INCH);
  1521. X!             XDrawString(tool_d, p, gc, i - 3,
  1522. X                  TOPRULER_HEIGHT - INCH_MARK - 3, number,
  1523. X                  j < PIX_PER_INCH * 10 ? 1 : 2);
  1524. X              }
  1525. X          else if (j % HINCH == 0)
  1526. X!             XDrawLine(tool_d, p, gc, i, TOPRULER_HEIGHT - 1, i,
  1527. X                  TOPRULER_HEIGHT - HALF_MARK - 1);
  1528. X          else if (j % QINCH == 0)
  1529. X!             XDrawLine(tool_d, p, gc, i, TOPRULER_HEIGHT - 1, i,
  1530. X                  TOPRULER_HEIGHT - QUARTER_MARK - 1);
  1531. X          else if (j % SINCH == 0)
  1532. X!             XDrawLine(tool_d, p, gc, i, TOPRULER_HEIGHT - 1, i,
  1533. X                  TOPRULER_HEIGHT - SIXTEENTH_MARK - 1);
  1534. X          }
  1535. X      else 
  1536. X!         for (i = TWOMM - 1; i <= TOPRULER_WIDTH; i++)
  1537. X          {
  1538. X          j = i + 1;
  1539. X          if (j % PIX_PER_CM == 0)
  1540. X              {
  1541. X!             XDrawLine(tool_d, p, gc, i, TOPRULER_HEIGHT - 1, i,
  1542. X                    TOPRULER_HEIGHT - INCH_MARK - 1);
  1543. X              sprintf(number, "%d", j / PIX_PER_CM);
  1544. X!             XDrawString(tool_d, p, gc, i - 3,
  1545. X                      TOPRULER_HEIGHT - INCH_MARK - 3, number,
  1546. X                      j < PIX_PER_CM * 10 ? 1 : 2);
  1547. X              }
  1548. X          else if (j % TWOMM == 0)
  1549. X!             XDrawLine(tool_d, p, gc, i, TOPRULER_HEIGHT - 1, i,
  1550. X                    TOPRULER_HEIGHT - QUARTER_MARK - 1);
  1551. X          }
  1552. X      ruler_args[0].value = (XtArgVal) p;
  1553. X--- 221,263 ----
  1554. X      XDrawString(tool_d, p, gc, 2, TOPRULER_HEIGHT - INCH_MARK - 3,
  1555. X              appres.INCHES ? "in" : "cm", 2);
  1556. X      if(appres.INCHES) 
  1557. X!         for (i = SINCH - 1; i <= (int)(OVERFACT*TOPRULER_WIDTH); i += SINCH)
  1558. X          {
  1559. X          j = i + 1;
  1560. X          if (j % PIX_PER_INCH == 0)
  1561. X              {
  1562. X!             XDrawLine(tool_d, p, gc, ZOOMX(i), TOPRULER_HEIGHT - 1, ZOOMX(i),
  1563. X                  TOPRULER_HEIGHT - INCH_MARK - 1);
  1564. X              sprintf(number, "%d", j / PIX_PER_INCH);
  1565. X!             XDrawString(tool_d, p, gc, ZOOMX(i) - 3,
  1566. X                  TOPRULER_HEIGHT - INCH_MARK - 3, number,
  1567. X                  j < PIX_PER_INCH * 10 ? 1 : 2);
  1568. X              }
  1569. X          else if (j % HINCH == 0)
  1570. X!             XDrawLine(tool_d, p, gc, ZOOMX(i), TOPRULER_HEIGHT - 1, ZOOMX(i),
  1571. X                  TOPRULER_HEIGHT - HALF_MARK - 1);
  1572. X          else if (j % QINCH == 0)
  1573. X!             XDrawLine(tool_d, p, gc, ZOOMX(i), TOPRULER_HEIGHT - 1, ZOOMX(i),
  1574. X                  TOPRULER_HEIGHT - QUARTER_MARK - 1);
  1575. X          else if (j % SINCH == 0)
  1576. X!             XDrawLine(tool_d, p, gc, ZOOMX(i), TOPRULER_HEIGHT - 1, ZOOMX(i),
  1577. X                  TOPRULER_HEIGHT - SIXTEENTH_MARK - 1);
  1578. X          }
  1579. X      else 
  1580. X!         for (i = TWOMM - 1; i <= (int)(OVERFACT*TOPRULER_WIDTH); i++)
  1581. X          {
  1582. X          j = i + 1;
  1583. X          if (j % PIX_PER_CM == 0)
  1584. X              {
  1585. X!             XDrawLine(tool_d, p, gc, ZOOMX(i), TOPRULER_HEIGHT - 1, ZOOMX(i),
  1586. X                    TOPRULER_HEIGHT - INCH_MARK - 1);
  1587. X              sprintf(number, "%d", j / PIX_PER_CM);
  1588. X!             XDrawString(tool_d, p, gc, ZOOMX(i) - 3,
  1589. X                      TOPRULER_HEIGHT - INCH_MARK - 3, number,
  1590. X                      j < PIX_PER_CM * 10 ? 1 : 2);
  1591. X              }
  1592. X          else if (j % TWOMM == 0)
  1593. X!             XDrawLine(tool_d, p, gc, ZOOMX(i), TOPRULER_HEIGHT - 1, ZOOMX(i),
  1594. X                    TOPRULER_HEIGHT - QUARTER_MARK - 1);
  1595. X          }
  1596. X      ruler_args[0].value = (XtArgVal) p;
  1597. X***************
  1598. X*** 264,269 ****
  1599. X--- 276,282 ----
  1600. X      XSetBackground(tool_d, gc, (unsigned long) 0);
  1601. X  
  1602. X      /* make pixmaps for top ruler arrow */
  1603. X+     if (toparrow_pm==NULL)
  1604. X      toparrow_pm = XCreatePixmap(tool_d, topruler_win, trm_pr.width,
  1605. X                      trm_pr.height,
  1606. X                      DefaultDepthOfScreen(tool_s));
  1607. X***************
  1608. X*** 271,279 ****
  1609. X          trm_pr.width, trm_pr.height);
  1610. X      
  1611. X      /* side ruler, adjustments for digits are kludges based on 6x13 char */
  1612. X      p = XCreatePixmap(tool_d, sideruler_win,
  1613. X!               SIDERULER_WIDTH, SIDERULER_HEIGHT,
  1614. X                DefaultDepthOfScreen(tool_s));
  1615. X      XtSetArg(tmp_arg[0], XtNbackground, &bg);
  1616. X      XtSetArg(tmp_arg[1], XtNforeground, &fg);
  1617. X      XtGetValues(sideruler_sw, tmp_arg, 2);
  1618. X--- 284,295 ----
  1619. X          trm_pr.width, trm_pr.height);
  1620. X      
  1621. X      /* side ruler, adjustments for digits are kludges based on 6x13 char */
  1622. X+     if (sideruler_pm!=NULL) XFreePixmap(tool_d,sideruler_pm);
  1623. X      p = XCreatePixmap(tool_d, sideruler_win,
  1624. X!               SIDERULER_WIDTH, (int)(OVERFACT*SIDERULER_HEIGHT),
  1625. X                DefaultDepthOfScreen(tool_s));
  1626. X+     sideruler_pm=p;
  1627. X+ 
  1628. X      XtSetArg(tmp_arg[0], XtNbackground, &bg);
  1629. X      XtSetArg(tmp_arg[1], XtNforeground, &fg);
  1630. X      XtGetValues(sideruler_sw, tmp_arg, 2);
  1631. X***************
  1632. X*** 281,287 ****
  1633. X      XSetBackground(tool_d, gc, bg);
  1634. X      XSetForeground(tool_d, gc, bg);
  1635. X      XFillRectangle(tool_d, p, gc, 0, 0, SIDERULER_WIDTH,
  1636. X!             SIDERULER_HEIGHT);
  1637. X      XSetForeground(tool_d, gc, fg);
  1638. X      
  1639. X      if( appres.INCHES ) 
  1640. X--- 297,303 ----
  1641. X      XSetBackground(tool_d, gc, bg);
  1642. X      XSetForeground(tool_d, gc, bg);
  1643. X      XFillRectangle(tool_d, p, gc, 0, 0, SIDERULER_WIDTH,
  1644. X!             (int)(OVERFACT*SIDERULER_HEIGHT));
  1645. X      XSetForeground(tool_d, gc, fg);
  1646. X      
  1647. X      if( appres.INCHES ) 
  1648. X***************
  1649. X*** 288,335 ****
  1650. X      {
  1651. X          if( appres.RHS_PANEL )
  1652. X          {
  1653. X!         for (i = SINCH - 1; i <= SIDERULER_HEIGHT; i += SINCH)
  1654. X          {
  1655. X              j = i + 1;
  1656. X              if (j % PIX_PER_INCH == 0)
  1657. X              {
  1658. X                  XDrawLine(tool_d, p, gc, RULER_WIDTH-INCH_MARK,
  1659. X!                       i, RULER_WIDTH, i);
  1660. X                  sprintf(number, "%d", j / PIX_PER_INCH);
  1661. X                  XDrawString(tool_d, p, gc,
  1662. X!                         RULER_WIDTH-INCH_MARK - 8, i + 3,
  1663. X                          number, j < PIX_PER_INCH * 10 ? 1 : 2);
  1664. X              }
  1665. X              else if (j % QINCH == 0)
  1666. X                  XDrawLine(tool_d, p, gc,
  1667. X!                       RULER_WIDTH-QUARTER_MARK, i,
  1668. X!                       RULER_WIDTH, i);
  1669. X              else if (j % SINCH == 0)
  1670. X                  XDrawLine(tool_d, p, gc,
  1671. X!                       RULER_WIDTH-SIXTEENTH_MARK, i,
  1672. X!                       RULER_WIDTH, i);
  1673. X          }
  1674. X          }
  1675. X          else
  1676. X          {
  1677. X!         for (i = SINCH - 1; i <= SIDERULER_HEIGHT; i += SINCH)
  1678. X          {
  1679. X              j = i + 1;
  1680. X              if (j % PIX_PER_INCH == 0)
  1681. X              {
  1682. X!                 XDrawLine(tool_d, p, gc, 0, i,
  1683. X!                       INCH_MARK - 1, i);
  1684. X                  sprintf(number, "%d", j / PIX_PER_INCH);
  1685. X                  XDrawString(tool_d, p, gc, INCH_MARK + 3,
  1686. X!                         i + 3, number,
  1687. X                          j < PIX_PER_INCH * 10 ? 1 : 2);
  1688. X              }    
  1689. X              else if (j % QINCH == 0)
  1690. X!                 XDrawLine(tool_d, p, gc, 0, i,
  1691. X!                       QUARTER_MARK - 1, i);
  1692. X              else if (j % SINCH == 0)
  1693. X!                 XDrawLine(tool_d, p, gc, 0, i,
  1694. X!                       SIXTEENTH_MARK - 1, i);
  1695. X          }    
  1696. X          }
  1697. X      }
  1698. X--- 304,351 ----
  1699. X      {
  1700. X          if( appres.RHS_PANEL )
  1701. X          {
  1702. X!         for (i = SINCH - 1; i <= (int)(OVERFACT*SIDERULER_HEIGHT); i += SINCH)
  1703. X          {
  1704. X              j = i + 1;
  1705. X              if (j % PIX_PER_INCH == 0)
  1706. X              {
  1707. X                  XDrawLine(tool_d, p, gc, RULER_WIDTH-INCH_MARK,
  1708. X!                       ZOOMY(i), RULER_WIDTH, ZOOMY(i));
  1709. X                  sprintf(number, "%d", j / PIX_PER_INCH);
  1710. X                  XDrawString(tool_d, p, gc,
  1711. X!                         RULER_WIDTH-INCH_MARK - 8, ZOOMY(i) + 3,
  1712. X                          number, j < PIX_PER_INCH * 10 ? 1 : 2);
  1713. X              }
  1714. X              else if (j % QINCH == 0)
  1715. X                  XDrawLine(tool_d, p, gc,
  1716. X!                       RULER_WIDTH-QUARTER_MARK, ZOOMY(i),
  1717. X!                       RULER_WIDTH, ZOOMY(i));
  1718. X              else if (j % SINCH == 0)
  1719. X                  XDrawLine(tool_d, p, gc,
  1720. X!                       RULER_WIDTH-SIXTEENTH_MARK, ZOOMY(i),
  1721. X!                       RULER_WIDTH, ZOOMY(i));
  1722. X          }
  1723. X          }
  1724. X          else
  1725. X          {
  1726. X!         for (i = SINCH - 1; i <= (int)(OVERFACT*SIDERULER_HEIGHT); i += SINCH)
  1727. X          {
  1728. X              j = i + 1;
  1729. X              if (j % PIX_PER_INCH == 0)
  1730. X              {
  1731. X!                 XDrawLine(tool_d, p, gc, 0, ZOOMY(i),
  1732. X!                       INCH_MARK - 1, ZOOMY(i));
  1733. X                  sprintf(number, "%d", j / PIX_PER_INCH);
  1734. X                  XDrawString(tool_d, p, gc, INCH_MARK + 3,
  1735. X!                         ZOOMY(i) + 3, number,
  1736. X                          j < PIX_PER_INCH * 10 ? 1 : 2);
  1737. X              }    
  1738. X              else if (j % QINCH == 0)
  1739. X!                 XDrawLine(tool_d, p, gc, 0, ZOOMY(i),
  1740. X!                       QUARTER_MARK - 1, ZOOMY(i));
  1741. X              else if (j % SINCH == 0)
  1742. X!                 XDrawLine(tool_d, p, gc, 0, ZOOMY(i),
  1743. X!                       SIXTEENTH_MARK - 1, ZOOMY(i));
  1744. X          }    
  1745. X          }
  1746. X      }
  1747. X***************
  1748. X*** 337,377 ****
  1749. X      {
  1750. X          if( appres.RHS_PANEL )
  1751. X          {
  1752. X!         for (i = TWOMM - 1; i <= SIDERULER_HEIGHT; i++)
  1753. X          {
  1754. X              j = i + 1;
  1755. X              if (j % PIX_PER_CM == 0)
  1756. X              {
  1757. X                  XDrawLine(tool_d, p, gc, RULER_WIDTH-INCH_MARK,
  1758. X!                       i, RULER_WIDTH, i);
  1759. X                  sprintf(number, "%d", j / PIX_PER_CM);
  1760. X                  XDrawString(tool_d, p, gc,
  1761. X!                         RULER_WIDTH-INCH_MARK - 8, i + 3,
  1762. X                          number, j < PIX_PER_CM * 10 ? 1 : 2);
  1763. X              }
  1764. X              else if (j % TWOMM == 0)
  1765. X                  XDrawLine(tool_d, p, gc,
  1766. X!                       RULER_WIDTH-QUARTER_MARK, i,
  1767. X!                       RULER_WIDTH, i);
  1768. X          }
  1769. X          }
  1770. X          else
  1771. X          {
  1772. X!         for (i = TWOMM - 1; i <= SIDERULER_HEIGHT; i++)
  1773. X          {
  1774. X              j = i + 1;
  1775. X              if (j % PIX_PER_CM == 0)
  1776. X              {
  1777. X!                 XDrawLine(tool_d, p, gc, 0, i,
  1778. X!                       INCH_MARK - 1, i);
  1779. X                  sprintf(number, "%d", j / PIX_PER_CM);
  1780. X                  XDrawString(tool_d, p, gc, INCH_MARK + 3,
  1781. X!                         i + 3, number,
  1782. X                          j < PIX_PER_CM * 10 ? 1 : 2);
  1783. X              }
  1784. X              else if (j % TWOMM == 0)
  1785. X!                 XDrawLine(tool_d, p, gc, 0, i,
  1786. X!                       QUARTER_MARK - 1, i);
  1787. X                  }
  1788. X          }
  1789. X      }
  1790. X--- 353,393 ----
  1791. X      {
  1792. X          if( appres.RHS_PANEL )
  1793. X          {
  1794. X!         for (i = TWOMM - 1; i <= (int)(OVERFACT*SIDERULER_HEIGHT); i++)
  1795. X          {
  1796. X              j = i + 1;
  1797. X              if (j % PIX_PER_CM == 0)
  1798. X              {
  1799. X                  XDrawLine(tool_d, p, gc, RULER_WIDTH-INCH_MARK,
  1800. X!                       ZOOMY(i), RULER_WIDTH, ZOOMY(i));
  1801. X                  sprintf(number, "%d", j / PIX_PER_CM);
  1802. X                  XDrawString(tool_d, p, gc,
  1803. X!                         RULER_WIDTH-INCH_MARK - 8, ZOOMY(i) + 3,
  1804. X                          number, j < PIX_PER_CM * 10 ? 1 : 2);
  1805. X              }
  1806. X              else if (j % TWOMM == 0)
  1807. X                  XDrawLine(tool_d, p, gc,
  1808. X!                       RULER_WIDTH-QUARTER_MARK, ZOOMY(i),
  1809. X!                       RULER_WIDTH, ZOOMY(i));
  1810. X          }
  1811. X          }
  1812. X          else
  1813. X          {
  1814. X!         for (i = TWOMM - 1; i <= (int)(OVERFACT*SIDERULER_HEIGHT); i++)
  1815. X          {
  1816. X              j = i + 1;
  1817. X              if (j % PIX_PER_CM == 0)
  1818. X              {
  1819. X!                 XDrawLine(tool_d, p, gc, 0, ZOOMY(i),
  1820. X!                       INCH_MARK - 1, ZOOMY(i));
  1821. X                  sprintf(number, "%d", j / PIX_PER_CM);
  1822. X                  XDrawString(tool_d, p, gc, INCH_MARK + 3,
  1823. X!                         ZOOMY(i) + 3, number,
  1824. X                          j < PIX_PER_CM * 10 ? 1 : 2);
  1825. X              }
  1826. X              else if (j % TWOMM == 0)
  1827. X!                 XDrawLine(tool_d, p, gc, 0, ZOOMY(i),
  1828. X!                       QUARTER_MARK - 1, ZOOMY(i));
  1829. X                  }
  1830. X          }
  1831. X      }
  1832. X***************
  1833. X*** 385,390 ****
  1834. X--- 401,407 ----
  1835. X      /* make pixmaps for side ruler arrow */
  1836. X      if( appres.RHS_PANEL )
  1837. X      {
  1838. X+         if (sidearrow_pm==NULL)
  1839. X          sidearrow_pm = XCreatePixmap(tool_d, sideruler_win,
  1840. X                           srlm_pr.width, srlm_pr.height,
  1841. X                           DefaultDepthOfScreen(tool_s));
  1842. X***************
  1843. X*** 393,398 ****
  1844. X--- 410,416 ----
  1845. X      }
  1846. X      else
  1847. X      {
  1848. X+         if (sidearrow_pm==NULL)
  1849. X          sidearrow_pm = XCreatePixmap(tool_d, sideruler_win,
  1850. X                           srrm_pr.width, srrm_pr.height,
  1851. X                           DefaultDepthOfScreen(tool_s));
  1852. X***************
  1853. X*** 424,434 ****
  1854. X          /* Because the ruler uses a background pixmap, we can win
  1855. X             here by using XClearArea to erase the old thing. */
  1856. X          XClearArea(tool_d, sideruler_win,
  1857. X!                RULER_WIDTH+srloffx, lasty + srloffy,
  1858. X                 srlm_pr.width, srlm_pr.height, False);
  1859. X          XCopyArea(tool_d, sidearrow_pm, sideruler_win,
  1860. X                sidegc, 0, 0, srlm_pr.width,
  1861. X!               srlm_pr.height, RULER_WIDTH+srloffx, y + srloffy);
  1862. X      }
  1863. X      else
  1864. X      {
  1865. X--- 442,453 ----
  1866. X          /* Because the ruler uses a background pixmap, we can win
  1867. X             here by using XClearArea to erase the old thing. */
  1868. X          XClearArea(tool_d, sideruler_win,
  1869. X!                RULER_WIDTH+srloffx, ZOOMY(lasty) + srloffy,
  1870. X                 srlm_pr.width, srlm_pr.height, False);
  1871. X          XCopyArea(tool_d, sidearrow_pm, sideruler_win,
  1872. X                sidegc, 0, 0, srlm_pr.width,
  1873. X!               srlm_pr.height, RULER_WIDTH+srloffx, 
  1874. X!               ZOOMY(y) + srloffy);
  1875. X      }
  1876. X      else
  1877. X      {
  1878. X***************
  1879. X*** 435,445 ****
  1880. X          /* Because the ruler uses a background pixmap, we can win
  1881. X             here by using XClearArea to erase the old thing. */
  1882. X          XClearArea(tool_d, sideruler_win,
  1883. X!                srroffx, lasty + srroffy,
  1884. X                 srlm_pr.width, srlm_pr.height, False);
  1885. X          XCopyArea(tool_d, sidearrow_pm, sideruler_win,
  1886. X                sidegc, 0, 0, srrm_pr.width,
  1887. X!               srrm_pr.height, srroffx, y + srroffy);
  1888. X      }
  1889. X      lasty = y;
  1890. X  }
  1891. X--- 454,464 ----
  1892. X          /* Because the ruler uses a background pixmap, we can win
  1893. X             here by using XClearArea to erase the old thing. */
  1894. X          XClearArea(tool_d, sideruler_win,
  1895. X!                srroffx, ZOOMY(lasty) + srroffy,
  1896. X                 srlm_pr.width, srlm_pr.height, False);
  1897. X          XCopyArea(tool_d, sidearrow_pm, sideruler_win,
  1898. X                sidegc, 0, 0, srrm_pr.width,
  1899. X!               srrm_pr.height, srroffx, ZOOMY(y) + srroffy);
  1900. X      }
  1901. X      lasty = y;
  1902. X  }
  1903. END_OF_FILE
  1904. if test 51091 -ne `wc -c <'patch10.3'`; then
  1905.     echo shar: \"'patch10.3'\" unpacked with wrong size!
  1906. fi
  1907. # end of 'patch10.3'
  1908. fi
  1909. echo shar: End of archive 2 \(of 4\).
  1910. cp /dev/null ark2isdone
  1911. MISSING=""
  1912. for I in 1 2 3 4 ; do
  1913.     if test ! -f ark${I}isdone ; then
  1914.     MISSING="${MISSING} ${I}"
  1915.     fi
  1916. done
  1917. if test "${MISSING}" = "" ; then
  1918.     echo You have unpacked all 4 archives.
  1919.     rm -f ark[1-9]isdone
  1920. else
  1921.     echo You still need to unpack the following archives:
  1922.     echo "        " ${MISSING}
  1923. fi
  1924. ##  End of shell archive.
  1925. exit 0
  1926.  
  1927. --
  1928. Dan Heller
  1929. O'Reilly && Associates       Z-Code Software    Comp-sources-x:
  1930. Senior Writer                President          comp-sources-x@uunet.uu.net
  1931. argv@ora.com                 argv@zipcode.com
  1932.